import Taro, { Component } from '@tarojs/taro'
import Index from './pages/index'
// 除了引入所需的组件，还需要手动引入组件样式
// app.js
import 'taro-ui/dist/style/index.scss' // 全局引入一次即可
import './app.scss'

// 如果需要在 h5 环境中开启 React Devtools
// 取消以下注释：
// if (process.env.NODE_ENV !== 'production' && process.env.TARO_ENV === 'h5')  {
//   require('nerv-devtools')
// }

class App extends Component {

  config = {
    pages: [
      'pages/index/index',
      'pages/product/product',
      'pages/product/details',
      'pages/product/applySuccess',
      'pages/news/news',
      'pages/news/newsDetail/newsDetail',
      'pages/news/policyDetail/policyDetail',
      'pages/mine/mine',
      'pages/mine/info',
      'pages/mine/about',
      'pages/search/search',
      'pages/finance/financeConfirm/financeConfirm',
      'pages/finance/financeEvaluate/financeEvaluate',
      'pages/financeSuccess/financeSuccess',
      'pages/chooseProduct/chooseProduct',
      'pages/applySuccess/applySuccess',
      'pages/needList/needList',
      'pages/wantToFinance/wantToFinance',
      'pages/publishSuccess/publishSuccess',
      'pages/need/need',
      'pages/Picks/Picks'
    ],
    window: {
      backgroundTextStyle: 'light',
      navigationBarBackgroundColor: '#fff',
      navigationBarTitleText: 'WeChat',
      navigationBarTextStyle: 'black'
    },
    tabBar: { 
      color: '#B2BAC5',
      selectedColor: '#C49868',
      backgroundColor: '#FFFFFF',
      list: [
        {
          pagePath: 'pages/index/index',
          text: '首页',
          iconPath: './images/tabBar/b1.png',
          selectedIconPath: './images/tabBar/a1.png'
        },{
          pagePath: 'pages/product/product',
          text: '金融产品',
          iconPath: './images/tabBar/b2.png',
          selectedIconPath: './images/tabBar/a2.png'
        },{
          pagePath: 'pages/news/news',
          text: '新闻政策',
          iconPath: './images/tabBar/b3.png',
          selectedIconPath: './images/tabBar/a3.png'
        },{
          pagePath: 'pages/mine/mine',
          text: '我的',
          iconPath: './images/tabBar/b4.png',
          selectedIconPath: './images/tabBar/a4.png'
        }
      ]
    }
  }

  componentDidMount () {}

  componentDidShow () {}

  componentDidHide () {}

  componentDidCatchError () {}

  // 在 App 类中的 render() 函数没有实际作用
  // 请勿修改此函数
  render () {
    return (
      <Index />
    )
  }
}

Taro.render(<App />, document.getElementById('app'))
